package game.model.building.vo 
{
	import flash.utils.getTimer;
	/**
	 * ...
	 * @author Thot
	 */
	 
	public class BuildingConfigVO 
	{
		
		// production par seconde
		public var prodMana:Vector.<int>;
		public var prodGold:Vector.<int>;
		public var costGold:Vector.<int>;
		public var costMana:Vector.<int>;
		public var costGems:Vector.<int>;
		public var nextLevelTime:Vector.<int>;
		public var name:String;
		public var id:int;
		
		public function BuildingConfigVO() 
		{
			prodGold = new Vector.<int>();
			prodMana = new Vector.<int>();
			costGems = new Vector.<int>();
			costGold = new Vector.<int>();
			costMana = new Vector.<int>();
			nextLevelTime = new Vector.<int>();
			name = "";
			id = 0;
		}
		
		public function destroy():void
		{
			prodGold = null;
			prodMana = null;
			costGems = null;
			costGold = null;
			costMana = null;
			nextLevelTime = null;
			name = null;
			id = 0;
		}
		
		//static
		
		static public function buildFromXML( p_obj:XML ):BuildingConfigVO
		{
			var vo:BuildingConfigVO = new BuildingConfigVO();
			
			vo.id 					= (int)(p_obj.id);
			vo.name 				= new String( p_obj.name );
			vo.nextLevelTime 		= Vector.<int>(String( p_obj.nextLevelTime ).split(","));
			vo.prodGold 			= Vector.<int>(String( p_obj.prodGold ).split(","));
			vo.prodMana 			= Vector.<int>(String( p_obj.prodMana ).split(","));
			vo.costGems 			= Vector.<int>(String( p_obj.costGems ).split(","));
			vo.costGold 			= Vector.<int>(String( p_obj.costGold ).split(","));
			vo.costMana 			= Vector.<int>(String( p_obj.costMana ).split(","));
			vo.nextLevelTime 		= Vector.<int>(String( p_obj.nextLevelTime ).split(","));
			
			return vo;
		}
	}

}